using System.Collections;
using System.Collections.Generic;
using UnityEngine;

[CreateAssetMenu(fileName ="New Item Effect",menuName ="Data/Effect/IceAndFir")]
public class IceAndFireItemEffect : ItemEffect
{
    public override void EquipEffect()
    {
        base.EquipEffect();
        PlayerManager.instance.player.OnEachAttackDamage += IceAndFireAttack;
    }

    public void IceAndFireAttack(Enemy enemy)
    { 
        PlayerStats playerStats = PlayerManager.instance.player.GetComponent<PlayerStats>();
        playerStats.DoMagicalDamage(enemy.GetComponent<EnemyStat>(),
            DamageType.FireDamage | DamageType.IceDamage,
            x =>  x + 5,  false);
    }

    public override void UnEquipEffect()
    {
        base.UnEquipEffect();
        PlayerManager.instance.player.OnEachAttackDamage -= IceAndFireAttack;
    }
}
